package com.ajax;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.Model.denglu.PanDuanZhangHao;

public class JianChaDengLu extends HttpServlet {

	/**
	 * The doPost method of the servlet. <br>
	 *
	 * This method is called when a form has its tag value method equals to post.
	 * 
	 * @param request the request send by the client to the server
	 * @param response the response send by the server to the client
	 * @throws ServletException if an error occurred
	 * @throws IOException if an error occurred
	 */
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		response.setContentType("text/html");
		request.setCharacterEncoding("UTF-8");
    	response.setCharacterEncoding("UTF-8");
		PrintWriter out = response.getWriter();
		String name = request.getParameter("userid");
		String pass = request.getParameter("passwordinput");
		String shenfen = request.getParameter("shenfen");
		PanDuanZhangHao panduan = new PanDuanZhangHao(name, pass, shenfen); //实例化判断账号密码的对象
		String flag = panduan.panDuan(); //第一次判断账号密码是否正确
		out.print(flag);
		out.flush();
		out.close();
	}

}
